<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="model.Salesman, model.ActionConstants"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<?xml version="1.0" charset="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

<html>
  <head>
    <title>Home</title>
  </head>
  <body>
    
    <img src="resources/images/logoDusa.gif" width="200" height="50" alt="logo" border="1"/>
    <br>
    
    Usuario: ${sessionScope.salesman.name}
    <c:if test='${requestScope.msg != null}'>
      <br/>
      <font color="#FF0000">${requestScope.msg}</font>
    </c:if>
    <c:if test='${requestScope.msg2 != null}'>
      <br/>
      <font color="#FF0000">${requestScope.msg2}</font>
    </c:if>
    
    <br/>
    <font size="2"><i>${sessionScope.customer.name}</i></font><br/>
    
    <form name="form1" action="OrderServlet" method="post">
      <table border="0">
        <tr>
          <% if (((Salesman)session.getAttribute("salesman")).checkAction(ActionConstants.CREAR_PEDIDO)) { %>
          <td><input type="submit" value="Crear Pedido" name="action" /></td>
          <% } %>
          <% if (((Salesman)session.getAttribute("salesman")).checkAction(ActionConstants.VER_INVENTARIO)) { %>
          <td><input type="submit" value="Inventario" name="action" /></td>
          <% } %>
          
        </tr>
        <tr>
          <% if (((Salesman)session.getAttribute("salesman")).checkAction(ActionConstants.EDO_CUENTA)) { %>
          <td><input type="submit" value="Ver Edo.Cta" name="action" /></td>  
          <% } %>
          <% if (((Salesman)session.getAttribute("salesman")).checkAction(ActionConstants.VER_CHEQUES)) { %>
          <td><input type="submit" value="Ver Cheques" name="action" /></td>
          <% } %>
        </tr>
        <tr>
          <% if (((Salesman)session.getAttribute("salesman")).checkAction(ActionConstants.REAL_VS_PLAN)) { %>
          <td><input type="submit" value="Real.Vs.Plan" name="action" /></td>
          <% } %>
          <% if (((Salesman)session.getAttribute("salesman")).checkAction(ActionConstants.CHEQUEAR_STATUS)) { %>
          <td><input type="submit" value="Status_Pedidos" name="action" /></td>
          <% } %>
        </tr>
      </table>
      <input type="hidden" name="return" value="showHome">
    </form>
    
    <a href="usrChgpwd.jsp">Cambiar Clave</a><br>
    <a href="LoginServlet?action=logoff">Cerrar Sesión</a>
    
  </body>
</html>
